macro normalize_name

Summary

This macro takes a name as an argument and returns a version of it that can be used as a column name.

Arguments

  1. name (required argument - the name to be normalized, in string format)

Functionality

{{ datacraft.normalize_name(name) }}

This macro takes a name as an argument and returns a version of it that can be used as a column name. The normalization process includes the following steps:

  1. Replace spaces with underscores.
  2. Transliterate any Cyrillic letters to their Latin equivalents.
  3. Remove non-alphanumeric symbols.

Example:

-- Normalize a column name
{{ datacraft.normalize_name('My Column Name') }}

Output:

My_Column_Name